home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / t2win-32 / _mailnws.frm (.txt) < prev    next >
Visual Basic Form  |  1998-07-13  |  10KB  |  209 lines

  1. VERSION 5.00
  2. Begin VB.Form frmMailNews 
  3.    BorderStyle     =   4  'Fixed ToolWindow
  4.    Caption         =   "Miscelleanous"
  5.    ClientHeight    =   6060
  6.    ClientLeft      =   1890
  7.    ClientTop       =   3270
  8.    ClientWidth     =   9270
  9.    MaxButton       =   0   'False
  10.    MDIChild        =   -1  'True
  11.    PaletteMode     =   1  'UseZOrder
  12.    ScaleHeight     =   6060
  13.    ScaleWidth      =   9270
  14.    ShowInTaskbar   =   0   'False
  15.    Begin VB.Frame Frame1 
  16.       Height          =   570
  17.       Left            =   0
  18.       TabIndex        =   1
  19.       Top             =   -90
  20.       Width           =   9270
  21.       Begin VB.CommandButton cmdNP 
  22.          Caption         =   ">"
  23.          Height          =   285
  24.          Index           =   1
  25.          Left            =   8910
  26.          TabIndex        =   6
  27.          Top             =   195
  28.          Width           =   285
  29.       End
  30.       Begin VB.CommandButton cmdNP 
  31.          Caption         =   "<"
  32.          Height          =   285
  33.          Index           =   0
  34.          Left            =   8010
  35.          TabIndex        =   5
  36.          Top             =   195
  37.          Width           =   285
  38.       End
  39.       Begin VB.CommandButton Command1 
  40.          Caption         =   "&Go"
  41.          Default         =   -1  'True
  42.          Height          =   285
  43.          Left            =   8370
  44.          TabIndex        =   4
  45.          Top             =   195
  46.          Width           =   465
  47.       End
  48.       Begin VB.ComboBox cmb_Function 
  49.          Height          =   315
  50.          Left            =   1365
  51.          TabIndex        =   2
  52.          Top             =   180
  53.          Width           =   6555
  54.       End
  55.       Begin VB.Label Label2 
  56.          Caption         =   "&Select a function"
  57.          Height          =   255
  58.          Left            =   90
  59.          TabIndex        =   3
  60.          Top             =   210
  61.          Width           =   1275
  62.       End
  63.    End
  64.    Begin VB.TextBox txt_Result 
  65.       BackColor       =   &H00C0C0C0&
  66.       BorderStyle     =   0  'None
  67.       Height          =   5325
  68.       Left            =   105
  69.       Locked          =   -1  'True
  70.       MultiLine       =   -1  'True
  71.       ScrollBars      =   2  'Vertical
  72.       TabIndex        =   0
  73.       Top             =   630
  74.       Width           =   9060
  75.    End
  76. Attribute VB_Name = "frmMailNews"
  77. Attribute VB_GlobalNameSpace = False
  78. Attribute VB_Creatable = False
  79. Attribute VB_PredeclaredId = True
  80. Attribute VB_Exposed = False
  81. Option Explicit
  82. Option Base 1
  83. Private Const Iteration = 100
  84. Dim IsLoaded         As Integer
  85. Dim TimerStartOk     As Integer
  86. Dim TimerCloseOk     As Integer
  87. Dim TimerHandle      As Integer
  88. Dim TimerValue       As Long
  89. Private Sub cmdNP_Click(Index As Integer)
  90.    Call sub_NextPrev(cmb_Function, Index)
  91. End Sub
  92. Private Sub cmb_Function_Click()
  93.    If (IsLoaded = False) Then Exit Sub
  94.    Call cDisableFI(mdiT2W.Picture1)
  95.    txt_Result = ""
  96.    DoEvents
  97.    Select Case cmb_Function.ListIndex
  98.       Case 0
  99.          Call TestMailNews
  100.    End Select
  101.    DoEvents
  102.    Call cEnableFI(mdiT2W.Picture1)
  103. End Sub
  104. Private Sub Form_Activate()
  105.    mdiT2W.Label2.Caption = cInsertBlocks(mdiT2W.Label2.Tag, "" & Iteration)
  106. End Sub
  107. Private Sub Form_Load()
  108.    IsLoaded = False
  109.    Show
  110.    Call sub_Load_Combo(cmb_Function, T2WDirInst + "_mailnws.t2w")
  111.    IsLoaded = True
  112. End Sub
  113. Private Sub Command1_Click()
  114.    Call cmb_Function_Click
  115. End Sub
  116. Private Sub TestMailNews()
  117.    Dim lResult          As Long
  118.    Dim strResult        As String
  119.    Dim strDisplay       As String
  120.    Dim i                As Integer
  121.    Dim File1            As String
  122.    Dim File2            As String
  123.    Dim File3            As String
  124.    Dim Ptr              As Long
  125.    Dim NextPtr          As Long
  126.    Dim FileName         As String
  127.    Dim TypeOfEncoding   As Integer
  128.    Dim FileState        As Long
  129.    Dim rc               As Integer
  130.    Dim ErrorDecodeOp    As Long
  131.    Dim ErrorMoveOp      As Long
  132.    ReDim FileM(1 To 3) As String
  133.    strResult = ""
  134.    strDisplay = ""
  135.    File1 = T2WFileTest
  136.    File2 = "autoexec.mailnews"
  137.    strDisplay = strDisplay & "File Copy '" & File1 & "' to '" & File2 & "' is " & cFileCopy(File1, File2) & vbCrLf & vbCrLf
  138.    strDisplay = strDisplay & "Encoding (if [ok] then [size of file] else [error]) with " & vbCrLf
  139.    strDisplay = strDisplay & "   header : MNHDR_MAIL" & vbCrLf
  140.    strDisplay = strDisplay & "   linesperfile : 0 (=> single-part)" & vbCrLf
  141.    strDisplay = strDisplay & "   sender : T2WIN-32" & vbCrLf
  142.    strDisplay = strDisplay & "   receiver : The MCR Company" & vbCrLf
  143.    strDisplay = strDisplay & "   subject : Mail & News from TIME TO WIN 32-Bit (...))" & vbCrLf & vbCrLf
  144.    FileM(1) = "autoexec.uuencode"
  145.    strDisplay = strDisplay & "      initialization is " & IIf(cMNInitialize() = MNRET_OK, "OK", "error") & vbCrLf
  146.    strDisplay = strDisplay & "         encode '" & File2 & "' into '" & FileM(1) & "' (uuencode) is " & cMNEncode(File2, FileM(1), FileM(1), MN_UU_ENCODED, 0, MNHDR_MAIL, "The MCR", "Company", "Mail & News from TIME TO WIN 32-Bit (UUENCODED)") & vbCrLf
  147.    strDisplay = strDisplay & "      shutdown is " & IIf(cMNShutdown() = MNRET_OK, "OK", "error") & vbCrLf & vbCrLf
  148.    FileM(2) = "autoexec.xxencode"
  149.    strDisplay = strDisplay & "      initialization is " & IIf(cMNInitialize() = MNRET_OK, "OK", "error") & vbCrLf
  150.    strDisplay = strDisplay & "         encode '" & File2 & "' into '" & FileM(2) & "' (xxencode) is " & cMNEncode(File2, FileM(2), FileM(2), MN_XX_ENCODED, 0, MNHDR_MAIL, "The MCR", "Company", "Mail & News from TIME TO WIN 32-Bit (XXENCODED)") & vbCrLf
  151.    strDisplay = strDisplay & "      shutdown is " & IIf(cMNShutdown() = MNRET_OK, "OK", "error") & vbCrLf & vbCrLf
  152.    FileM(3) = "autoexec.b64encode"
  153.    strDisplay = strDisplay & "      initialization is " & IIf(cMNInitialize() = MNRET_OK, "OK", "error") & vbCrLf
  154.    strDisplay = strDisplay & "         encode '" & File2 & "' into '" & FileM(3) & "' (b64encode) is " & cMNEncode(File2, FileM(3), FileM(3), MN_B64ENCODED, 0, MNHDR_MAIL, "The MCR", "Company", "Mail & News from TIME TO WIN 32-Bit (B64ENCODED)") & vbCrLf
  155.    strDisplay = strDisplay & "      shutdown is " & IIf(cMNShutdown() = MNRET_OK, "OK", "error") & vbCrLf & vbCrLf
  156.    File3 = "autoexec.compound"
  157.    strDisplay = strDisplay & "Merge '" & FileM(1) & "' and '" & FileM(2) & "' and '" & FileM(3) & " into '" & File3 & "' is " & cFileMergeExt(FileM(), File3) & vbCrLf & vbCrLf
  158.    strDisplay = strDisplay & "Loading '" & File3 & "' in the list of files to be processed" & vbCrLf & vbCrLf
  159.    strDisplay = strDisplay & "   initialization is " & IIf(cMNInitialize() = MNRET_OK, "OK", "error") & vbCrLf
  160.    strDisplay = strDisplay & "      loadinlist is " & cMNLoadInList(File3, False) & vbCrLf
  161.    strDisplay = strDisplay & "      countinlist is " & cMNCountInList() & vbCrLf & vbCrLf
  162.    strDisplay = strDisplay & "   enumeration of all files in the current list of files :" & vbCrLf & vbCrLf
  163.    If (cMNFirstInList(Ptr) = True) Then
  164.       i = 1
  165.       Do
  166.          rc = cMNWalkInList(Ptr, FileName, TypeOfEncoding, FileState, NextPtr)
  167.          strDisplay = strDisplay & "      file(" & i & ") is '" & FileName & "' (typeofencoding : " & TypeOfEncoding & ", filestate : " & FileState & ")" & vbCrLf
  168.          i = i + 1
  169.          Ptr = NextPtr
  170.       Loop Until rc = False
  171.       strDisplay = strDisplay & vbCrLf
  172.    Else
  173.       strDisplay = strDisplay & "      no files found" & vbCrLf & vbCrLf
  174.    End If
  175.    strDisplay = strDisplay & "   shutdown is " & IIf(cMNShutdown() = MNRET_OK, "OK", "error") & vbCrLf & vbCrLf
  176.       
  177.    strDisplay = strDisplay & "   Decoding of all files in the current list of files" & vbCrLf & vbCrLf
  178.    strDisplay = strDisplay & "   initialization is " & IIf(cMNInitialize() = MNRET_OK, "OK", "error") & vbCrLf
  179.    strDisplay = strDisplay & "      loadinlist is " & cMNLoadInList(File3, False) & vbCrLf
  180.    strDisplay = strDisplay & "      countinlist is " & cMNCountInList() & vbCrLf & vbCrLf
  181.    If (cMNFirstInList(Ptr) = True) Then
  182.       i = 1
  183.       Do
  184.          rc = cMNWalkInList(Ptr, FileName, TypeOfEncoding, FileState, NextPtr)
  185.          strDisplay = strDisplay & "      file(" & i & ") is '" & FileName & "'" & vbCrLf
  186.          strDisplay = strDisplay & "         rename into 'testma